package org.smoke.dao;

import net.paoding.rose.jade.annotation.DAO;
import net.paoding.rose.jade.annotation.ReturnGeneratedKeys;
import net.paoding.rose.jade.annotation.SQL;
import org.smoke.bean.User;

/**
 * @author hezhiyu on 15/5/2.
 */
@DAO
public interface UserDAO {

    @SQL("INSERT INTO user (name, password, create_time) VALUES (:1.name, :1.password, :1.createTime)")
    @ReturnGeneratedKeys
    public Long saveUser(User user);

    @SQL("SELECT uid, name FROM user WHERE name = :1 AND password = :2")
    public User getUser(String name, String pass);

    @SQL("SELECT uid FROM user WHERE name = :1")
    public Long getUidByName(String name);
}
